#ifndef _DATA_MANAGER_H
#define _DATA_MANAGER_H

#include "growingarray.h"
#include "Vector.h"

namespace Utilities
{
	class DataManager
	{
	public:
		DataManager();
		~DataManager();

		void AddParameter(const std::string& aParameterName, bool& aParameter);
		void AddParameter(const std::string& aParameterName, Vector2f& aParameter);

		bool ReadData(const std::string& aFileName);
		bool ReadData(OS::File& aFile);

		bool WriteData(const std::string& aFileName);
		bool WriteData(OS::File& aFile);

	private:
		struct Parameter
		{
			enum Type
			{
				BOOL,
				INT,
				FLOAT,
				VECTOR2F,
				VECTOR3F,
				VECTOR4F,
			};

			std::string name;
			Type type;
			void* data;
		};

		void AddParameter(const std::string& aParameterName, void* aData);
		void ReadParameter(Parameter& aParameter, OS::File& aFile);
		void WriteParameter(Parameter& aParameter, OS::File& aFile);
	private:
		Utilities::GrowingArray<Parameter> myParameters;
	};
}

#endif